package com.vinhvt.effiport.data;

import java.sql.DriverManager;
import java.sql.SQLException;

public class ConnectionManagerMySQL extends ConnectionManager {
	private final String DRIVER_CLASS = "com.mysql.jdbc.Driver";
	public ConnectionManagerMySQL(String database, String username, String password) {		
		
		try {
			Class.forName(DRIVER_CLASS).newInstance();
		} catch (InstantiationException e) {
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			e.printStackTrace();
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		}           
    	try {
			connection = DriverManager.getConnection("jdbc:mysql://localhost/" + database 
					+ "?user=" + username 
					+ "&password=" + password 
					+ "&useUnicode=true&characterEncoding=utf8");
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}

}
